/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 东莞呵呵
 * Date:2022-07-13
 * Time:15:16
 */
public class Solution {
    public void merge(int nums1[], int m, int nums2[], int n) {
        int i=0;
        int j=0;
        while (i<m&&j<n){
            if(nums1[i]>nums2[j]){
                for (int k = m - 1; k >= i; k--) {
                    nums1[k+1]=nums1[k];
                }
                nums1[i]=nums2[j];
                j++;
                m++;
            }
            else{
                i++;
            }

        }
        while (j<n){
            nums1[i++]=nums2[j++];
        }
    }

}
